package store;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;



public class ServiceProduct {

	public void search (Long numId){
		
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("myPersistenceUnit");
		EntityManager em= emf.createEntityManager();
		
		@SuppressWarnings("unchecked")
		List <Product> result = em.createQuery(" select p from Product p where p.id= :numId").setParameter("numId", numId).getResultList();
		
		System.out.println(result);
		
	}
	
	
}
